﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/PBOAMasterPage.master"
    AutoEventWireup="true" CodeFile="RoleManagement.aspx.cs" Inherits="SystemManagePage_RoleManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../CSS/SystemManagePages.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="SystemManage">
        <div id="top_sysmanage">
            <uc:Navigator runat="server" Text="角色管理" />
        </div>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="AddRole_sysmanage">
                <ul>
                    <li class="Lift_sysmanage">
                        <asp:Label ID="LabelRoleName" runat="server" Text="角色名称："></asp:Label></li>
                    <li>
                        <asp:TextBox ID="TextBoxRoleName" runat="server" BorderColor="#66FFCC" BorderStyle="Inset"
                            Width="200px" MaxLength="50"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                runat="server" ErrorMessage="角色名不能为空" ControlToValidate="TextBoxRoleName" Display="Dynamic"
                                ForeColor="Red"></asp:RequiredFieldValidator></li>
                    <li class="Lift_sysmanage">
                        <asp:Label ID="LabelRoleMeno" runat="server" Text="说明："></asp:Label></li>
                    <li>
                        <asp:TextBox ID="TextBoxRoleMeno" runat="server" BorderColor="#66FFCC" BorderStyle="Inset"
                            Height="50px" Width="200px"></asp:TextBox></li>
                    <li>
                        <asp:Button ID="ButtonAdd" runat="server" Text="添加" /></li>
                </ul>
            </div>
            <div id="RoleMessage_sysmanage">
                <asp:GridView ID="GridViewRoleMessage" runat="server" CellPadding="4" ForeColor="#333333"
                    GridLines="None" Width="740px" DataSourceID="EntityDataSource1" AutoGenerateColumns="False"
                    DataKeyNames="RoleNo" CssClass="Gridview_sysmanage">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="RoleId" HeaderText="角色名称" SortExpression="RoleId" />
                        <asp:BoundField DataField="RoleIntroduction" HeaderText="角色说明" SortExpression="RoleIntroduction" />
                        <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/file/cancel.gif" CausesValidation="False"
                            EditImageUrl="~/Images/edit.gif" HeaderText="修改" ShowEditButton="True" UpdateImageUrl="~/Images/file/save1.gif" />
                        <asp:TemplateField ConvertEmptyStringToNull="False" HeaderText="删除" ShowHeader="False">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" ImageUrl="~/Images/delete.gif"
                                    Text="删除" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="RoleNo" HeaderText="RoleNo" ReadOnly="True" SortExpression="RoleNo"
                            Visible="False" />
                        <asp:HyperLinkField DataNavigateUrlFields="RoleNo" HeaderText="分配角色权限" 
                            Text="分配权限" DataNavigateUrlFormatString="Power.aspx?Role={0}" />
                        <asp:HyperLinkField DataNavigateUrlFields="RoleNo" HeaderText="分配角色用户" Text="分配用户" />
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
                <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=MyOfficeEntities"
                    DefaultContainerName="MyOfficeEntities" EnableDelete="True" EnableFlattening="False"
                    EnableUpdate="True" EntitySetName="Roles" EntityTypeFilter="Role">
                </asp:EntityDataSource>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="GridViewRoleMessage" />
            <asp:AsyncPostBackTrigger ControlID="ButtonAdd" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
